package net.kleinhenz.norabase.client.datasource;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import java.util.Map;

import net.kleinhenz.norabase.shared.SortOrientation;
import net.kleinhenz.norabase.shared.TextMatchStyle;
import net.kleinhenz.norabase.shared.model.Champion;
import net.kleinhenz.norabase.shared.model.FetchResult;

@RemoteServiceRelativePath("championds")
public interface ChampionDSService extends RemoteService {

    FetchResult<Champion> fetch(int start, int end, Map<String, SortOrientation> sortSpec, TextMatchStyle textMatchStyle, Map<String, Object> criteria);
    Champion update(Champion record);

    public static class Util {
		private static ChampionDSServiceAsync instance;
		public static ChampionDSServiceAsync getInstance() {
			return (instance == null) ? (instance = GWT.create(ChampionDSService.class)) : instance;
		}
	}

}
